import ScrollBar from "@/components/ScrollBar";
import { Empty, Modal } from "antd";
import React from "react";
import EmptyPath from "@/assets/36.svg";
const ErrorLog: React.FC<{
	open: boolean;
	onCancel: () => void;
	value: API.Setting.OperlogVo | any;
}> = ({ open = false, onCancel = () => {}, value }) => {
	return (
		<Modal
			title="错误日志堆栈详情"
			width={1200}
			styles={{
				body: { height: 600 }
			}}
			open={open}
			footer={false}
			onCancel={onCancel}
		>
			{value?.errorStackTrace ? (
				<ScrollBar>
					<div
						style={{
							background: "rgb(51, 51, 51)",
							color: "rgb(153, 153, 153)",
							padding: "5px 20px",
							lineHeight: "1.5"
						}}
					>
						{value.errorStackTrace}
					</div>
				</ScrollBar>
			) : (
				<Empty
					imageStyle={{
						height: 200,
						width: 200
					}}
					style={{ height: 600, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center" }}
					image={EmptyPath}
				/>
			)}
		</Modal>
	);
};
export default ErrorLog;
